<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
	Authenticate::adminLogin($_POST['username'], $_POST['password']);
	if(Authenticate::getAdminType() == Authenticate::TYPE_ACCOUNTING){
		header("Location: old.php?page=accounting/index");
	}
	else if(Authenticate::getAdminType() == Authenticate::TYPE_TECHNIC){
		header("Location: old.php?page=technic/index");
	}
	else{
		Helper::refresh();
		View::display('error', 'Login Failed');
	}
}else{
	View::display('staff.login');
}